/**
 * snes.c
 * Implementation for SNES functionality.
 * 
 * @author  Philippe Johnson
 */

#include "snes.h"
#include "65c816.h"

BOOL initializeSNES( CartridgeInfo* info ) {
	initializeMemory( info );
    initializeCPU( info );
}

void uninitializeSNES() {
    /* TODO */
}

void runSNES() {
    int cycles = 50;
    int i = 0;

    cpuExecute(cycles);
}

BOOL loadCartridge( char* filename, CartridgeInfo* info ) {
    BOOL    retVal = TRUE;
    RomInfo romInfo;

    retVal = loadRom( filename, &romInfo );
    if(!retVal) {
        DEBUGMSG("loadCartridge error: failed to load ROM.\n");
        goto loadCartridgeFail;
    }

    info->romSize = romInfo.size;
    info->romType = romInfo.type;

loadCartridgeFail:
    return retVal;
}
